<?php
$this->_var['ujs'][] = $this->_var['TMPL_REAL']."/js/u.js";
$this->_var['cujs'][] = $this->_var['TMPL_REAL']."/js/u.js";
?>
<script type="text/javascript">
function closeWeeboxs(){
	$.weeboxs.close();
}
</script>
<script type="text/javascript" src="{function name="parse_script" v="$ujs" c="$cujs"}"></script>
<div class="list_title clearfix">
	<div><a href="{url x="index"r="uc_deal#refund" p="status=0"}">还款列表</a></div>
	<div><a href="{url x="index"r="uc_deal#refund" p="status=1"}">已还清借款</a></div>
	<div class="cur"><a href="###">还款详情</a></div>
</div>
<div class="wb clearfix pl10 pr10 pt5 pb5">
	<div class="bid_item clearfix">
        <div class="bid_title">
        	<span class="f_l">{$deal.name} 还款记录!</span>
            <span class="r_c"><a href="javascript:void(0);" onclick="openWeeboxFrame('{url x="index" r="uc_deal#contract" p="id=$deal.id"}','电子协议',1024,668);">查看电子协议</a></span>
        </div>
		<div class="blank0"></div>
        <div class="bid_detail">
            <div class="info">
            	 借款金额：
                <span class="f_red">{$deal.borrow_amount_format}</span>
            </div>
            <div class="info">
            	年利率：
                <span class="f_red">{function name="number_format" v=$deal.rate f=2}%</span>
            </div>
            <div class="info">
            	期限：
                <span class="f_red">{$deal.repay_time}{if $deal.repay_time_type eq 0}天{else}个月{/if}</span>
            </div>
            <div class="info">
            	已还本息：
                <span class="f_red">{function name="app_conf" v="CURRENCY_UNIT"}{function name="number_format" v=$repay_money f=2}</span>
            </div>
			<div class="info">
				管理费：
				<span class="f_red">￥{function name="number_format" v=$manage_fee f=2}</span>
			</div>
			{if $impose_money neq 0}
			<div class="info">
				逾期/违约：<span class="f_red">￥{function name="number_format" v=$impose_money f=2}</span>
			</div>
			{/if}
			<div class="info">
            	还款方式：
                <span class="f_red">{function name="loantypename" v="$deal.loantype"}</span>
            </div>
            
        </div>
    </div>
	
	<div style="padding: 20px 0 10px 0;font-size: 14px;font-weight: bold;color: #565656;">
                还款记录
   	</div>
	<div class="clearfix">
		<table class="data_table" id="refundTab" cellspacing="1">
            <tr>
                <th width="10%">还款日</th>
                <th width="12%">实际还款日</th>
                <th>已还金额</th>
                <th width="10%">借款管理费</th>
                <th width="12%">逾期/违约金</th>
                <th width="10%">状态</th>
				<th width="6%">明细</th>
            </tr>
			<?php $idx=0;?>
			{foreach from=$loan_list item=loan key=key name="loans"}
          	<tr>
                <td>
                	{$loan.repay_time_format}
				</td>
                <td>{$loan.true_repay_time_format}</td>
                <td>{$loan.repay_money_format}</td>
                <td>{$loan.manage_money_format}</td>
                <td style="color:red">{$loan.impose_money_format}</td>
                <td class="f_green">
					{$loan.status_format}
				</td>
				<td>
					<a href="javascript:viewLoanItem('.Text-{$key}',{$deal.id},{$loan.l_key});">查看</a>
				</td>
				
            </tr>
			<tr class="hide Text-{$key}">
				<td colspan="7">
					<div class="p10">
					loading...
					</div>
				</td>
			</tr>
			{/foreach}
        </table>
		
		<table class="refundTab">
	        <tr>
	            <td colspan="8">
	                <div style="font-size: 16px; display: block;line-height: 200%;font-weight: bold;height: 50px;text-align: left;">
	                    <div class="blank10"></div>
						<span style="padding: 0px;display: block;float: left;">
						{if $inrepay_info}
						因在<span class="f_red">{function name="to_date" v=$inrepay_info.true_repay_time f="Y-m-d"}</span>提前还款<span class="f_red">{function name="app_conf" v="CURRENCY_UNIT"}{function name="number_format" v=$inrepay_info.repay_money f=2}</span>，故计算方式改变。
						<div class="blank1"></div>
						{/if}
						管理费：<span class="f_red">￥{function name="number_format" v=$manage_fee f=2}</span>
						<div class="blank1"></div>
						{if $impose_money neq 0}
						逾期/违约：<span class="f_red">￥{function name="number_format" v=$impose_money f=2}</span>
						{/if}
						<div class="blank1"></div>
						本息还款：<span class="f_red">￥{function name="number_format" v=$repay_money f=2}</span>
						</span>
	                </div>
	            </td>
	        </tr>
	    </table>
		
	</div>
</div>